<?php

namespace app\admin\server\index;

use app\admin\model\index\Admin as AdminModel;
use app\admin\model\music\MusicModel;
use app\admin\model\order\OrderMusicModel;
use app\admin\model\user\UserModel;
use app\admin\ServerBase;
use think\Request;

class IndexServer extends ServerBase
{
    public function __construct(Request $request)
    {
        $this->REQUEST = $request;
    }

    function statistics(){
        //用户总数
        $user_count = UserModel::count();
        //订单总量
        $music_order_count = OrderMusicModel::where('status','>','10')->count();
        //订单总金额
        $music_order_count = OrderMusicModel::where('status','>','10')->sum('order_price');
        //音乐总数
        $music_count = MusicModel::count();
        //今日订单数
        $music_order_count = OrderMusicModel::whereDay('create_time')->where('status','>','10')->count();
        //昨日订单数
        $music_order_count = OrderMusicModel::whereDay('create_time','yesterday')->where('status','>','10')->count();
        //近7天订单数
        $music_order_count = OrderMusicModel::whereDay('create_time','yesterday')->where('status','>','10')->count();

        //本月订单数
    }
}